<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/mall-common :: common_head(~{::title},~{::link},~{::script})">
  <title>订单确认 -网上图书商城</title>
  <link rel="stylesheet" href="/styles/mall/order-confirm.css">
  <script src="/javascript/mall/order-confirm.js" type="text/javascript"></script>
</head>
<body>
<div th:replace="common/mall-common::mall-header"></div>
<div class="mall-body">
  <div class="tip-title">请您确认订单信息：</div>
  <div class="cart-item-list">
    <div class="cart-item" th:each="item:${cartItemList}">
      <input type="hidden" name="cartItems" th:value="${item.id}"/>
      <img class="sku-img" th:src="${item.booksSkuDTO.getBooksSkuImgList().get(0).getImage()}"/>
      <div class="cart-info">
        <div class="goods-name" th:text="${item.books.name}"></div>

        <div class="goods-place" th:text="'作者：' + ${item.books.author}"></div>
     <!--     <div class="goods-place" th:text="'出版社：' +${item.books.belongpublish.name}"></div>
-->
        <div class="sku-price"
             th:text="${item.booksSkuDTO.currentPrice + ' x ' + item.count + ' = ' + item.booksSkuDTO.currentPrice * item.count} + '元'"></div>
      </div>
    </div>
  </div>
  <form action="/submitOrder" method="post">
    <div class="full-info">
      <input type="hidden" name="fromType" th:value="${fromType}"/>
      <input type="hidden" name="cartItems" th:each="item,info:${cartItems}" th:value="${item}"/>
      <input type="hidden" name="skuId" th:value="${skuId}"/>
      <input type="hidden" name="booksCount" th:value="${booksCount}"/>
      <input type="hidden" name="totalPrice" th:value="${totalPrice}"/>
      <div class="info-line">
        请选择收货地址：
        <select class="form-select shipping-address-select" name="shippingAddress">
          <option th:each="item:${shippingAddressList}"
                  th:text="${item.province + ' ' + item.city + ' ' + item.district + ' ' + item.detailAddress}"></option>
        </select>
      </div>
      <div class="info-line" th:text="'共计商品总数：' + ${booksCount} + '件'"></div>
      <div class="info-line" th:text="'总计金额：' + ${totalPrice} + '元'"></div>
    </div>
    <div class="actions-area">
      <button type="submit" class="btn btn-success buy-btn">确认下单</button>
    </div>
  </form>
</div>
<div th:replace="common/mall-common::mall-footer"></div>
</body>
</html>